import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_study_app/module/visit/page/visit_calendar_page.dart';
import 'package:flutter_study_app/widget/my_app_bar.dart';

class VisitZonePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _VisitZonePageState();
}

class _VisitZonePageState extends State<VisitZonePage>
    with TickerProviderStateMixin {
  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(
        title: '走访专区',
      ),
      body: Column(
        children: [
          Container(
            height: 40.w,
            color: Colors.white,
            child: TabBar(
              tabs: [
                Tab(
                  text: '走访日历',
                ),
                Tab(
                  text: '走访记录',
                ),
                Tab(
                  text: '走访地图',
                ),
              ],
              labelColor: Color(0xff009669),
              labelStyle: TextStyle(fontSize: 15.sp),
              unselectedLabelColor: Color(0xff333333),
              unselectedLabelStyle: TextStyle(fontSize: 15.sp),
              indicatorPadding: EdgeInsets.only(left: 20.w, right: 20.w),
              indicatorColor: Color(0xff009669),
              indicatorWeight: 2.w,
              controller: _tabController,
            ),
          ),
          Expanded(
            child: Container(
              color: Color(0xfff0f0f0),
              child: TabBarView(
                controller: _tabController,
                children: [VisitCalendarPage(), Text('Page02'), Text('Page03')],
              ),
            ),
          ),
        ],
      ),
    );
  }
}
